﻿using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Linq;
using WaitLess.Business.Data.Model;
using WaitLess.Business.Data.Model.Antwerpen;
using WaitLess.Business.Data.Web;
using WaitLess.Business.Data.Web.Interfaces;
using WaitLess.Business.Repositories;
using WaitLess.Business.Repositories.Interfaces;
using WaitLess.Business.Tests.Common;

namespace WaitLess.Business.Tests.Integration.Repositories.StadskantoorRepositorySpecifications
{
    [TestClass]
    public class WhenGetAll : AsyncTestBase
    {
        protected IStadskantoorRepository StadskantoorRepository { get; private set; }
        protected IWebRequestor WebRequestor { get; private set; }
        public Stadskantoren Result { get; set; }

        protected override void Arrange()
        {
            base.Arrange();
            WebRequestor = new WebRequestor();
            StadskantoorRepository = new StadskantoorRepository(WebRequestor);
        }

        protected override void Act()
        {
            StadskantoorRepository.GetAll(result =>
            {
                Result = result;
                IsActCompleted = true;
            });
        }

        [TestMethod]
        public void ThenResultShouldNotBeEmpty()
        {
            Assert.IsNotNull(Result);
            Assert.IsNotNull(Result.stadskantoor);
            Assert.IsTrue(Result.stadskantoor.Any());
        }
    }
}
